package com.flyox.game.militarychess.server.services.data;

import java.util.Hashtable;

import com.flyox.game.militarychess.bean.ChessDesk;
import com.flyox.game.militarychess.bean.ChessMan;
import com.flyox.game.militarychess.bean.Player;

public class SystemInfo {
	
	private static Hashtable<String, Player> players = new Hashtable<String, Player>();
	private static Hashtable<Integer, ChessDesk> desks = new Hashtable<Integer, ChessDesk>();
	private static Hashtable<Integer, ChessMan[][]> chessLayouts = new Hashtable<Integer, ChessMan[][]>();
	static{
		for(int i=1;i<9;i++){
			ChessDesk cd=new ChessDesk(i);
			desks.put(i, cd);
		}
	}

	public Hashtable<String, Player> getPlayers() {
		return players;
	}

	public Hashtable<Integer, ChessDesk> getDesks() {
		return desks;
	}

	public Hashtable<Integer, ChessMan[][]> getChessLayouts() {
		return chessLayouts;
	}
	
//	public static void showInfos(){
//		Enumeration<Player> e1=players.elements();
//		Player p=null;
//		while(e1.hasMoreElements()){
//			p=e1.nextElement();
//			System.out.print(" desk num:"+p.getDeskNum()+" seatName:"+p.getSeatName()+" userName:"+p.getName());
//		}
//		System.out.println();
//		
//		Enumeration<ChessDesk> e2=desks.elements();
//		ChessDesk c=null;
//		while(e2.hasMoreElements()){
//			c=e2.nextElement();
//			System.out.print(" deskNum:"+c.getDeskNum()+" deskState:"+c.getDeskStates());
//			System.out.println();
//			Hashtable<SEAT_NAME, ChessSeat> seats=c.getSeats();
//			System.out.print(" state:"+seats.get(SEAT_NAME.S1).getSeatState());
//			System.out.print(" state:"+seats.get(SEAT_NAME.S2).getSeatState());
//			System.out.print(" state:"+seats.get(SEAT_NAME.S3).getSeatState());
//			System.out.print(" state:"+seats.get(SEAT_NAME.S4).getSeatState());
//			System.out.print(" state:"+seats.get(SEAT_NAME.S5).getSeatState());
//			System.out.print(" state:"+seats.get(SEAT_NAME.S6).getSeatState());
//			System.out.print(" state:"+seats.get(SEAT_NAME.S7).getSeatState());
//			System.out.println(" state:"+seats.get(SEAT_NAME.S8).getSeatState());
//		}
//		System.out.println();
//	}
}
